package com.cc.micro.common.util;

/**
 * @author CC
 * time 2023-07-02
 * description 通用工具
 */
public final class CommonUtil {
    /**
     * 手机号数据脱敏
     * @param phone 手机号
     * @return
     */
    public static String maskedPhone(String phone){
        if (phone==null||phone==""||phone.trim().length()!=11) {
            return "***********";
        }
        phone=phone.trim();
        return phone.substring(0,3)+"******"+phone.substring(9,11);
    }

}
